package ControlLayer;
import DBLayer.GuestDB;
import ModelLayer.Guest;

public class GuestCtr 
{
	public static void main(String args[])
	{
		
	}
	
	public Guest guestLogin(String userName, String password) 
	{
		GuestDB guestDB = new GuestDB();
        Guest guest = guestDB.findGuest(userName, password);

        if (guest == null) 
        {
            throw new NullPointerException();
        }
        else 
        {
            return guestLogin(null, null);
        }
	}
	
	
	public int insertGuest(String fName, String lName, String adress, String country, String phone, String eMail, String travelAgency)
	{
		Guest guest = new Guest();
		
		guest.setFname(fName);
		guest.setLname(lName);
		guest.setAddress(adress);
		guest.setCountry(country);
		guest.setPhone(phone);
		guest.setEmail(eMail);
		guest.setTravelAgency(travelAgency);
		//guest.setId(guestId);
		
		GuestDB guestDB = new GuestDB();
		
		return guestDB.insertGuest(guest);
	}
}